<template>
    <div>
        姓名<input type="text" v-model="state.name">
        电话号<input type="text" v-model="state.phone">
        <input type="button" value="查询" @click="Show">
        <table class="table table-bordered">
            <tr>
                <td>Id</td>
                <td>名字</td>
                <td>照片</td>
                <td>电话号</td>
                <td>是否</td>
                <td>操作</td>
            </tr>
            <tr v-for="item in list">
                <td>{{ item.id }}</td>
                <td>{{ item.name }}</td>
                <td>
                    <img :src="item.imgage" alt="" width="100" height="100">
                    </td>
                <td>{{ item.phone }}</td>
                <td>{{ item.isNo==1 ?  "男":"女" }}</td>
                <td>
                    <input type="button" value="修改" @click="">
                    <input type="button" value="删除" @click="">  
                </td>
            </tr>
        </table>
    </div>
</template>

<script setup lang="ts">
import { reactive, toRefs, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';

let router = useRouter();
let route = useRoute();

let data: any = reactive({
    state: {
        "name": "",
        
        "phone": "",
     

    },
    list: [],
});

let { state,list } = toRefs(data);
onMounted(() => {
    Show();
});

const Show = () => {

    let obj = {

        "name": state.value.name,
        "phone": state.value.phone,
      
       
    }
    axios({
        url: '/api/House/GteHouse',
        method: 'get',
        params: obj
    }).then((res) => {
        list.value=res.data.data
    })

}




</script>

<style scoped></style>